//
// Created by 陈成 on 2019/9/19.
//

#ifndef RV32I_CPU_INSTB_H
#define RV32I_CPU_INSTB_H

#include "Inst.h"

class InstB : public Inst {
public:
    InstB(uint32_t pc, sc_bv<32> value, RegBank<REG_NUM> *r, RegBank<CSR_NUM> *csr, Mem *m);

    uint32_t
    exec() override;

private:
    sc_bv<13> imm;
    sc_bv< 5> rs2;
    sc_bv< 5> rs1;
    sc_bv< 3> funct3;
    sc_bv< 7> opcode;

    uint32_t
    handleType0();
};


#endif //RV32I_CPU_INSTB_H
